layui.use(['form', 'layer', 'table', 'laytpl'], function () {
	var $ = layui.jquery,
		table = layui.table;
	window.active = {
		// 重新渲染
		reload: () => {
			table.reload("tableListTable");
		},
		// 编辑发货跳转
		edit: (data) => {
			popEdit(data, 'page/order/edit.html', ["620px", "720px"])
		},
		// 发货跳转
		send:(data)=>{
			popEdit(data, 'page/order/send.html', ["620px", "720px"])
		}
	}

	//表格外按钮操作
	$('.tableHead .layui-btn').on('click', function () {
		var type = $(this).data('type');
		active[type] ? active[type].call(this) : '';
	});
	//表格按钮操作
	table.on('tool(tableList)', function (obj) {
		var type = obj.event;
		active[type] ? active[type].call(this, obj.data) : '';
	});
})